<?php
/**
 * Représente un type d'unité
 */
class U1_Unit extends SW_Unit
{
	const STAT_STRUCTURE = 0;

	const STAT_DEFENSE = 1;

	const STAT_SHIED = 2;

	const STAT_ATTACK = 3;

	const STAT_SIZE = 4;

	const STAT_FREIGHT = 5;


	/** @var array : {structure, defense, shied, attack, freight}*/
	public $stats = array();


	public function getStat($key)
	{
		return $this->stats[$key] * $this->count;
	}

	public function initAttack()
	{
		$this->structure	= $this->count * $this->stats[self::STAT_STRUCTURE];
		$this->defense		= $this->count * $this->stats[self::STAT_DEFENSE];
		$this->shied		= $this->count * $this->stats[self::STAT_SHIED];
		$this->attack		= $this->count * $this->stats[self::STAT_ATTACK];
		$this->size			= $this->count * $this->stats[self::STAT_SIZE];
	}
}